﻿using LY.DataAccess.Repository;
using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.PageSearch;
using LY.Entity.SearchEntity;
using LY.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.Business.ServiceImpl
{
    public class CompanyService : ICompanyService
    {
        CompanyRepository _company;
        public CompanyService()
        {
            _company = new CompanyRepository();
        }
        //添加公司基本信息
        public int SaveCopmpany(U_Company company)
        {
            if (company.Id>0)
            {
                return (int)_company.Update(company);
            }
            else
            {
                return (int)_company.Insert(company);
            }
          
        }
        //根据会员ID 得到公司实体
        public U_Company GetCompany(int memberId)
        {
            return _company.GetCompany(memberId);
        }
        //公司列表
        public PagedList<U_CompanyAnnex_EX> QueryCompanyList(CompanySearch search, PageView view)
        {
            return _company.QueryCompanyList(search, view);
        }

        public U_Company GetModel(int id)
        {
            return _company.GetModel(id);
        }


        public PagedList<U_Company_EX> QueryCompany_EXList(CompanySearch search, PageView view)
        {
            return _company.QueryCompany_EXList(search, view);
        }
    }
}
